/**
 * Created by Administrator on 2017/8/3.
 */
var express = require('express');
var router = express.Router();
var userController = require('../controllers/user');
var promise = require('../util/promise');

//user列表页
router.get('/list', userController.loginPermission, userController.superAdminPermission, promise(userController.list));
//user注册页
router.get('/signup', promise(userController.signup));
//user登录页
router.get('/signin', promise(userController.signin));
//user进行注册
router.post('/create', promise(userController.create));
//user进行登录
router.post('/login', promise(userController.login));
//user进行登出
router.get('/logout', userController.loginPermission, promise(userController.logout));
//user进行删除
router.post('/del', userController.loginPermission, userController.superAdminPermission, promise(userController.del));
//user进行修改
router.post('/update', userController.loginPermission, promise(userController.update));

module.exports = router;